<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="util.js"></script>
    <style>
        div{
            width: 200px;
            height: 200px;
            background: papayawhip;
        }
    </style>
</head>
<body>
    <div></div>
    <script>
        var div = document.querySelector('div')
        div.onclick = function(){
            var timer = setInterval(function(){
                var wid = div.offsetWidth
                var w = getstyle(div,'width')
                // getstyle(div,'width') = wid +10 +'px'
                div.style.width = wid + 10 + 'px'
                if(wid>=1000){
                    div.style.width = '1001px'
                    clearInterval(timer)
                }
            },50)
        }
    </script>
</body>
</html>